package com.example.dynamicschedule.service.impl;

import com.alibaba.fastjson.JSON;
import com.example.dynamicschedule.dao.IamGroupMapper;
import com.example.dynamicschedule.service.IamGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class IamGroupServiceImpl implements IamGroupService {
    @Autowired
    private IamGroupMapper iamGroupMapper;

    @Override
    public Map<String, String> selectByCode() {
        Map<String, String> resultMap = new HashMap<>();
        Map<String, Map<String, String>> stringMapMap = iamGroupMapper.selectByCode();
        for (Map.Entry<String, Map<String, String>> stringMapEntry : stringMapMap.entrySet()) {
            Map<String, String> value = stringMapEntry.getValue();
            String zh_code = value.get("zh_code");
            String fh_code = value.get("fh_code");
            resultMap.put(zh_code,fh_code);
        }
        return resultMap;
    }
}
